class Resource::ItemsController < ApplicationController
  def sub_layout
    "resources"
  end

  def switch_bookmarked
    item_id = params[:item_id] || 0
    preview = params[:preview] || '0'

    item = Resource::Item.find(item_id)
    item.update_attribute(:bookmarked, !item.bookmarked)

    @preview = preview.to_i
    @active = item.bookmarked
    @item_id = item_id
    @updated = true
    render :partial => 'resource/items/bookmark'
  end
end
